package com.liuweiheng.cloudproviderpayment8002.mq.receiver;

import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * 消费者：广播 Work Queue 模式
 */
@Component
public class WorkReceiver {


    @RabbitListener(queuesToDeclare = @Queue(value = "work"))
    public void recevie1(String message) {
        System.out.println("消费者1：" + message);
    }

    @RabbitListener(queuesToDeclare = @Queue(value = "work"))
    public void recevie2(String message) {
        System.out.println("消费者2：" + message);
    }



}
